import gradio as gr
import random


def random_response(message, history):
    return random.choice(["Yes", "No"])


def launch_gradio():
    demo = gr.ChatInterface(
        random_response,
        chatbot=gr.Chatbot(height=600),
        textbox=gr.Textbox(
            placeholder="Ask me a yes or no question", container=False, scale=7),
        title="Yes Man",
        description="Ask Yes Man any question",
        theme="soft",
        cache_examples=True,
        retry_btn=None,
        undo_btn=None,
        clear_btn="Clear",
    )

    demo.launch()


if __name__ == '__main__':
    launch_gradio()
    pass
